﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Clotho.MdStore {
    public interface IMdItem {
        string Name { get; set; }
        List<IMdItem> Sub_items { get; set; }
        /// <summary>
        /// 获取描述字符串
        /// </summary>
        /// <returns>描述字符串</returns>
        string[] getDescription();
        /// <summary>
        /// 通过描述字符串生成此节点
        /// </summary>
        /// <param name="desc">描述字符串</param>
        void setDescription(string[] desc,int offset,int len);

    }
    public static class EMdItem {
        public static void addItem(this IMdItem item, IMdItem Sub_item) {
            if(item.Sub_items == null) {
                item.Sub_items = new List<IMdItem>();
			}
            item.Sub_items.Add(Sub_item);
        }

    }
}
